Field of the Invention
Embodiments of the present invention relate generally to computer software and, more specifically, to software dependency shading.
Description of the Related Art
The process of generating an executable software application based on application source code is referred to as a software “build” process. Such a process typically involves compiling application source code to generate binary object files and then linking the binary object files with binary “libraries” to generate the executable software application. The libraries implemented in a build process usually include previously compiled code that may be used by any number of software applications as well as other libraries. Oftentimes, multiple versions of a particular library exist, and different software applications and libraries may use different versions of that library. Accordingly, version-specific dependencies can exist between the binary files required to generate an executable software application.
However, in many common programming languages, only one version of any binary object may be represented in the executable software application at any given time. For example, suppose that a video recommendation application depends on a first version of a graphical user interface (GUI) library and a second version of a sorting library. Further, suppose that the first version of the GUI library depends on a first version of the sorting library. Finally, suppose that the correct behavior of the software application requires the second version instead of the first version of the sorting library, and the correct behavior of the GUI library requires the first version instead of the second version of the sorting library. In such a scenario, the build engine would select only one version of the sorting library to resolve the dependency conflict. Consequently, when the video recommendation application executes, the video recommendation application may crash or behave incorrectly.
For example, suppose that the build engine includes the second version of the sorting library in the executable video recommendation application. Further, suppose that the first version of the sorting library contains a software routine “foo”, and the second version of the library removes this routine. Finally, suppose that the correct operation of the GUI library depends on code contained in the first version of the sorting library. At runtime, because of version conflict resolution, only the second version of the sorting library is present. As the video recommendation application executes, instructions associated with the GUI library attempt to access the software routine foo. Because the software routine foo has been removed in the second version of the sorting library, the executable video recommendation application terminates unexpectedly.
In an attempt to avoid such scenarios, software developers may attempt to eliminate dependency conflicts prior to executing the software build. For example, in a “dependency locking” approach, software developers endeavor to select, maintain, and enforce a specific set of versions of all libraries that are dependencies of the software application. The resulting software application code and library code is then tested using the locked set of versions of the libraries. However, dependency locking is primarily a manually-based process that is time consuming, susceptible to errors, and undesirably reliant on complete compliance with the locked set of versions of libraries. For example, if developers do not comply (test, etc.) with the locked set of versions of libraries, then dependency conflicts could still exist. Further, updating a locked set of versions of libraries to implement bug fixes or incorporate new software features usually requires extensive coordination and testing and, as a result, can cause substantial delays when trying to fix or upgrade the executable software application.
As the foregoing illustrates, what is needed in the art are more effective techniques for reducing dependency conflicts when generating executable software applications.